<template>
 <div class="mui-numbox" data-numbox-min='1' data-numbox-step='1' >
					<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
					<input id="test" class="mui-input-numbox" type="number" :value="cou"  @change='changecount' ref='numbox' />
					<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
	</div>

</template>
<script>
import mui from '../../lib/js/mui.js';
    export default{
        data(){
            return {}
        },
        mounted(){
            mui('.mui-numbox').numbox();          
        },
        methods:{
            changecount(){                 
                // 每当商量数量改变就同步到购物车中
                this.$store.commit('updateGoodsInfo',{
                    id:this.goodsid,
                    cou:this.$refs.numbox.value
                })
            }
        },
        props:['cou','goodsid']
    }
</script>
<style lang='scss' scoped>
    .mui-numbox{
        height: 25px;
        width:100px;
    }
</style>
